package tmt.usercenter.web.repository;


import com.tmt.jpa.jpaservice.ITmtBaseRepo;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import tmt.usercenter.web.domain.ClientSystem;
import tmt.usercenter.web.domain.UserInfoConfig;

import java.util.List;

public interface IUserRegisterConfigRepo extends ITmtBaseRepo<UserInfoConfig, Long> {

    //@Query("select t from UserInfoConfig t where t.originSystem.clientId=:clientId")
    UserInfoConfig findByOriginSystem_ClientId(String clientId);

    UserInfoConfig findByOriginSystemId(Long systemId);

    @Query("select t.originSystem.id from UserInfoConfig t where t.clientGroupId = :clientGroupId")
    List<Long> getOriginSystemIdsByClientGroupId(@Param("clientGroupId") String clientGroupId);

    List<UserInfoConfig> findAllByClientGroupId(String groupId);

}
